<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%><%@page import="java.util.Map"%>

<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>生产单信息列表</title>
</head>
<script type="text/javascript">
function del(cid){
	if(confirm("确定删除该生产单吗？")){
		window.location.href="<%=request.getContextPath()%>/clientDel.action?cid="+cid;
	}
	
}

function setMachine(tid){
	doQueryMess("/pressystem/MachineList.action?operate=inspage&taskid="+tid+"","","700","400");
}

function resetMachine(tid,mtid){
	doQueryMess("/pressystem/MachineList.action?operate=inspage&isreset=true&mtid="+mtid+"&taskid="+tid+"","","700","400");
}

function upd(cid){
	window.location.href="<%=request.getContextPath()%>/clientUpdSel.action?cid="+cid;
}
</script>
<body>
<form action="<%=request.getContextPath()%>/taskList.action" method="post">
<table width="760" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody">
      <tr>
        <td class="MainBody_title">生产单信息</td>
      </tr>
      <tr>
        <td valign="top" colspan="2">
        <table border="0" cellspacing="0" cellpadding="0" style="margin: 5px 0 10px 20px;width:90%">
			<tr height="35">
				<td align="right" ></td>
				<td align="right" ><input type="button" value="查询" class="btn" onclick="doSel()"/></td>
			</tr>
			<tr >
				<td colspan="2" class="box01">
				<SPAN>生产单名称：<input type="text" name="taskname" value="${taskname}" maxlength="30"></SPAN>
				<SPAN>订单名称：<input type="text" name="name" value="${name}" maxlength="30"></SPAN>
				</td>
			</tr>
		</table>
        <table border="0" cellpadding="0" cellspacing="0"  class="MainBody_table">
           <tr>
				<th nowrap="nowrap">序号</th>
				<th nowrap="nowrap">生产单名称</th>
				<th nowrap="nowrap">订单名称</th>
				<th nowrap="nowrap">印刷尺寸</th>
				<th nowrap="nowrap">CTP</th>
				<th nowrap="nowrap">成品数量</th>
				<th nowrap="nowrap">状态</th>
				<th nowrap="nowrap">操作</th>
			</tr>

             	<% 
             	if(request.getAttribute("list")!=null&&!((List)request.getAttribute("list")).isEmpty()){
             		List list = (List)request.getAttribute("list");
             		for(int i=0;i<list.size();i++){
             			Map c = (Map)list.get(i);
             	 %>
			<tr>
				<td align="center" nowrap="nowrap"><%=i+1 %></td>
				<td align="center" nowrap="nowrap"><a href="<%=request.getContextPath()%>/taskSel.action?tid=<%=c.get("tid") %>&oid=<%=c.get("oid") %>" title="生产单详细信息"><%=c.get("taskname") %></a></td>
				<td align="center" nowrap="nowrap"><%=c.get("ordername") %></td>
				<td align="center" nowrap="nowrap"><%=c.get("printSize") %></td>
				<td align="center" nowrap="nowrap"><%=c.get("CTP") %></td>
				<td align="center" nowrap="nowrap"><%=c.get("amount") %></td>
				<td align="center" nowrap="nowrap"><%=c.get("taskStatus") %></td>
				<td align="center" nowrap="nowrap">
				<%if(c.get("mtid")==null||"".equals(c.get("mtid"))){
				%>
				<a href="#" title="安排设备" onclick = "return setMachine('<%=c.get("taskid")%>')"><font style="color: red">[安排设备]</font></a>
				<%}else{
				%>	
			    <a href="#" title="重新安排设备" onclick = "return resetMachine('<%=c.get("taskid")%>','<%=c.get("mtid") %>')"><font style="color: green">[重新安排]</font></a>
				<%} %>
				</td> 
			</tr>
			<%}//for end
             }else{%>
		<tr>
			<td align="center" colspan="8">暂时没有您可以浏览的数据</td>
		</tr>
			<%
				} %>
          </table>
          <table border="0" cellpadding="0" cellspacing="0" class="MainBody_fun">
            <tr>
              <td>
               <hello:AllPage />
			  </td>
            </tr>
          </table>
          </td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>